/*

 This program is free software; you can redistribute it and/or
 modify it under the terms of the GNU General Public License
 as published by the Free Software Foundation; version 2
 of the License.

 This program is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.

 You should have received a copy of the GNU General Public License
 along with this program; if not, write to the Free Software
 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.

*/
#import "IconManager.h"

static IconManager *sharedInstance = nil;

@implementation IconManager


+ (IconManager *) sharedInstance {
	return ( sharedInstance ? sharedInstance : ( sharedInstance = [[self alloc] init] ) );
}

-(id)init
{
   self = [super init];
   m_iconDictionary = [[NSMutableDictionary alloc] initWithCapacity:5];
   return self;
}

-(void)dealloc
{
   [m_iconDictionary release];
   [super dealloc];
}

-(UIImage*)getIcon:(NSString*) iconName
{
   UIImage* image = [m_iconDictionary objectForKey:iconName];
      
   if (image == nil)
   {
      image = [UIImage imageAtPath:[[NSBundle mainBundle] pathForResource:iconName ofType:@"png"]];
	  [m_iconDictionary setObject:[image retain] forKey:iconName];
   }
   return image;

}

-(UIImage*)getMusicIcon
{
   return [self getIcon: @"icon-AudioPlayer"];
}

-(UIImage*)getPicturesIcon
{
   return [self getIcon: @"icon-Photos"];
}

-(UIImage*)getVideosIcon
{
   return [self getIcon: @"icon-VideoPlayer"];
}

-(UIImage*)getFilesIcon
{
   return [self getIcon: @"icon-Files"];
}

-(UIImage*)getMusicItemIcon
{
   return [self getIcon: @"BarSongs"];
}

-(UIImage*)getVideoItemIcon
{
   return [self getIcon: @"BarVideos"];
}

-(UIImage*)getPictureItemIcon
{
   return [self getIcon: @"CameraIcon"];
}



-(UIImage*)getPlaylistIcon
{
   return [self getIcon: @"BarPlaylists"];
}

-(UIImage*)getFolderIcon
{
   return [self getIcon: @"Category"];
}

-(UIImage*)getPrevTrackIcon
{
	return [self getIcon: @"skipbackbutton"];
}

-(UIImage*)getPlayPauseIcon
{
	return [self getIcon: @"playpausebutton"];
}

-(UIImage*)getNextTrackIcon
{
	return [self getIcon: @"skipforwardbutton"];
}

-(UIImage*)getPrevTrackIcon_Pressed
{
	return [self getIcon: @"skipbackbutton_down"];
}

-(UIImage*)getPlayPauseIcon_Pressed
{
	return [self getIcon: @"playpausebutton_down"];
}

-(UIImage*)getNextTrackIcon_Pressed
{
	return [self getIcon: @"skipforwardbutton_down"];
}


@end